<template>
  <div>
    <el-form :model="queryParams" ref="queryForm" size="medium" :inline="true" label-width="60px">
      <el-form-item label="查询栏" prop="upkeepTypeId">
        <el-select v-model="queryParams.upkeepTypeId" placeholder="请选择保养标准" style="width:100%" clearable
          @keyup.enter.native="handleQuery">
          <el-option v-for="(dict, index) in upkeepList" :key="index" :label="dict.typeName" :value="dict.upkeepTypeId">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="" prop="faultDescribe">
        <el-input v-model="queryParams.faultDescribe" placeholder="请输入问题描述"
          @keyup.enter.native="handleQuery"></el-input>
      </el-form-item>
      <el-form-item label="" prop="experienceType">
        <el-select v-model="queryParams.experienceType" placeholder="请选择经验分类" style="width:100%" clearable
          @keyup.enter.native="handleQuery">
          <el-option v-for="(dict, index) in dict.type.experience_type" :key="index" :label="dict.label"
            :value="dict.value">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="medium" @click="handleSelect">
          搜索
        </el-button>
        <el-button icon="el-icon-refresh" size="medium" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { getupkeepList } from "@/api/knowledge/draftbase.js";
export default {
  dicts: ['experience_type'],
  data () {
    return {
      // 查询参数
      queryParams: {
        experienceType: undefined,
        faultDescribe: undefined,
        upkeepTypeId: undefined
      },
      upkeepList: []
    }
  },
  computed: {
  },
  mounted () {
    this.getinit()
  },
  methods: {
    async getinit () {
      let { data: data } = await getupkeepList({ status: '0' })//启用中
      this.upkeepList = data
    },
    handleSelect () {
      this.$emit('handleQuery', this.queryParams)
    },
    resetQuery () {
      for (const key in this.queryParams) {
        this.queryParams[key] = null
      }
      this.$emit('handleQuery', this.queryParams)
    }
  }
}
</script>

<style>

</style>